package com.sims.action.electricalFile;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.sims.bean.EfileResult;
import com.sims.bean.EfileVolunteer;
import com.sims.bean.ElectricalFile;
import com.sims.bean.Student;
import com.sims.service.ElectricalFileService;
import com.sims.util.ActionEnhanced;
import com.sims.util.Constant;

@SuppressWarnings("serial")
public class FindElectricalFileAction extends ActionEnhanced {
	
	private Student student = new Student();
	private ElectricalFile electricalFile = new ElectricalFile();
	private List<EfileResult> efileResultList = new ArrayList<EfileResult>();
	private List<EfileVolunteer> efileVolunteerList = new ArrayList<EfileVolunteer>();
	
	
	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	public ElectricalFile getElectricalFile() {
		return electricalFile;
	}

	public void setElectricalFile(ElectricalFile electricalFile) {
		this.electricalFile = electricalFile;
	}

	public List<EfileResult> getEfileResultList() {
		return efileResultList;
	}

	public void setEfileResultList(List<EfileResult> efileResultList) {
		this.efileResultList = efileResultList;
	}

	public List<EfileVolunteer> getEfileVolunteerList() {
		return efileVolunteerList;
	}

	public void setEfileVolunteerList(List<EfileVolunteer> efileVolunteerList) {
		this.efileVolunteerList = efileVolunteerList;
	}

	@Autowired
	private ElectricalFileService electricalFileService;
	
	@Override
	public String execute() {
		result = electricalFileService.findElectricalFile(student, electricalFile,efileResultList,efileVolunteerList);
		if (result.containsKey(Constant.SUCCESS)) {
			System.out.println("success");
			return SUCCESS;
		}
		return ERROR;
	}
}
